<?php
namespace Hr\OnlineBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Hr\OnlineBundle\Form\UserType; // parent form

class UserEditType extends UserType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
		
		parent::buildForm($builder, $options);        

		$builder->remove('email');
		$builder->remove('password');
		$builder->remove('repeatPassword');

		$builder->add('earliestStartDate', 'date', array(
			'years' => range(date('Y'), date('Y') + 3),
			'format' => 'dd.MM.yyyy',
			'required'=> false
	    ));

		$builder->add('noticePeriod');
		$builder->add('minSalary', 'text', array('required'=> false, 'label'=>'Salary requirements', 'attr'=>array('class'=>'currency', 'title'=>'Brutto per Annum')));
		$builder->add('objectives', 'textarea', array('required'=> false, 'label'=>'Professional goals / areas of interest'));
		$builder->add('willingnessToTravel', 'checkbox', array('required'=> false,));
		$builder->add('relocationNotes','textarea', array('required'=> false, 'label'=>'(Re)location notes'));
		$builder->add('drivingLicense', 'text', array('required'=> false, 'attr'=>array('class'=>'multiAutocomplete', 'data-options'=>'A,A1,B,BE,C1,C1E,C,CE,D1,D1E,D,DE', 'title'=>'Please select from the autocomplete list.')));
		
    }

    public function getName()
    {
        return 'user';
    }
}